package com.synergy.stockflow.procure.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.synergy.stockflow.production.entity.ProductionPlan;
import com.synergy.stockflow.warehouse.entity.Warehouse;
import io.swagger.v3.oas.annotations.media.Schema;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import javafx.beans.binding.When;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

@Schema
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "purchase_returns")
public class PurchaseReturns {
    /**
     * 退货单编码
     */
    @TableId(value = "purchase_returns_id")
    @Schema(description="退货单编码")
    private String purchaseReturnsId;

    /**
     * 采购单编码
     */
    @TableField(value = "purchase_returns_purchase_order_id")
    @Schema(description="采购单编码")
    private String purchaseReturnsPurchaseOrderId;

    /**
     * 退货仓库
     */
    @TableField(value = "purchase_returns_returns_warehouse")
    @Schema(description="退货仓库")
    private String purchaseReturnsReturnsWarehouse;

    /**
     * 退货数量
     */
    @TableField(value = "purchase_returns_number_of_returns")
    @Schema(description="退货数量")
    private BigDecimal purchaseReturnsNumberOfReturns;

    /**
     * 退货金额
     */
    @TableField(value = "purchase_returns_return_price")
    @Schema(description="退货金额")
    private BigDecimal purchaseReturnsReturnPrice;

    /**
     * 确认退货
     */
    @TableField(value = "purchase_returns_confirm")
    @Schema(description="确认退货")
    private String purchaseReturnsConfirm;

    /**
     * 退货时间
     */
    @TableField(value = "purchase_returns_return_time")
    @Schema(description="退货时间")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date purchaseReturnsReturnTime;

    /**
     * 经办人
     */
    @TableField(value = "purchase_returns_attn")
    @Schema(description="经办人")
    private String purchaseReturnsAttn;

    @TableField(exist = false)
    @Schema(description="员工姓名")
    private String nickname;

    @TableField(exist = false)
    @Schema(description="仓库")
    private Warehouse warehouse;

    @TableField(exist = false)
    @Schema(description="退货详情")
    private List<ReturnDetails> returnDetailsList;
}